package com.qf.controller;

import com.qf.demo.dto.UserDto;
import com.qf.demo.order.Order;
import com.qf.demo.user.User;
import com.qf.service.IOrderService;
import com.qf.service.IUserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@RequestMapping("user")
public class UserController {
    @Resource
    private IUserService iUserService;
    @Resource
    private IOrderService iOrderService;

    /**
     * 添加上数据
     * @param userDto
     * @return
     */
    @PostMapping("/createUser")
    public User createUser(@RequestBody UserDto userDto) {
        return iUserService.createUser(userDto);
    }

}

